﻿using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Xml.Serialization;
using UnityEngine;

public class XMLseriaLoad : MonoBehaviour
{
    
    void Start()
    {
        string path = Application.persistentDataPath + "/serializeTest.xml";

        if(File.Exists(path))
        {
            using (StreamReader sr = new StreamReader(path))
            {
                //必须是要序列化类型的模板
                XmlSerializer xs = new XmlSerializer(typeof(MyInfo1));
                //反序列化
                MyInfo1 mi = xs.Deserialize(sr) as MyInfo1;
            }
        }
    }

}
